from sqlalchemy import Column, Integer, DateTime
from sqlalchemy.ext.declarative import declarative_base
from datetime import datetime

Base = declarative_base()

class TimeModel(Base):
    """时间戳基础模型"""
    __abstract__ = True

    id = Column(Integer, primary_key=True, index=True)
    created_time = Column(DateTime, default=datetime.utcnow, comment="创建时间")
    updated_time = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, comment="更新时间")
